public class Clientclass {
    //简单工厂
    public static void main(String[] args) {
        //TODO Auto-generater method stub
        Factory factor=new Factory();

        Fruit fruit=factor.CreateFruit("A");
        fruit.eat();
    }
    public String factory(String fruitname){
        if(fruitname.equals("apple"))
            return"apple";
        if(fruitname.equals("Banana"))
            return "Bannana";
        return null;
    }
}